﻿<UserControl x:Class="gestadh45.wpf.UserControls.OutilsUC.GraphiquesUC"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
			 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4" 
			 xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
			 xmlns:customControls="clr-namespace:Controls;assembly=Controls"
			 xmlns:chartingToolkit="clr-namespace:System.Windows.Controls.DataVisualization;assembly=System.Windows.Controls.DataVisualization.Toolkit"
			 xmlns:enum="clr-namespace:gestadh45.business.Enums;assembly=gestadh45.business"
			 mc:Ignorable="d" 
			 d:DesignHeight="400" d:DesignWidth="600">
	<DockPanel Margin="5,5,5,5">
		<TextBlock DockPanel.Dock="Top"
			Text="{Binding Source={x:Static enum:CodesUC.EcranStatistiques}, Converter={StaticResource ResourceKey=CodeUCToString}}"
			HorizontalAlignment="Stretch" Margin="0,5,0,10" 
			TextAlignment="Center" Style="{StaticResource ResourceKey=titreUC}" />

		<ComboBox Name="comboChoixGraph" ItemsSource="{Binding Path=ListeGraphs}" DockPanel.Dock="Top">
			<i:Interaction.Triggers>
				<i:EventTrigger EventName="SelectionChanged">
					<cmd:EventToCommand 
							Command="{Binding Path=ChangeChartCommand, Mode=OneWay}" 
							CommandParameter="{Binding ElementName=comboChoixGraph, Path=SelectedItem}" />
				</i:EventTrigger>
			</i:Interaction.Triggers>

			<ComboBox.ItemTemplate>
				<DataTemplate>
					<TextBlock Text="{Binding Converter={StaticResource ResourceKey=CodeGraphToString}}" />
				</DataTemplate>
			</ComboBox.ItemTemplate>
		</ComboBox>

		<Separator Margin="0,10,0,10" />

		<customControls:LabeledPieChart x:Name="TestPieChart" Title="{Binding Path=TitreGraph}">
			<customControls:LabeledPieChart.Series>
				<customControls:LabeledPieSeries Name="labeledPieSeries"
												 ItemsSource="{Binding Path=ChartKeysValues}"
												 IndependentValueBinding="{Binding Path=Key}"
												 DependentValueBinding="{Binding Path=Value}"
												 IsSelectionEnabled="True"
												 PieChartLabelStyle="{DynamicResource ResourceKey=pieChartLabelStyle}"
												 PieChartLabelItemTemplate="{DynamicResource ResourceKey=pieChartLabelDataTemplate}"
												 LabelDisplayMode="Connected" />
			</customControls:LabeledPieChart.Series>
		</customControls:LabeledPieChart>
	</DockPanel>
</UserControl>
